<!DOCTYPE html>
<html>
<head>
    
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-104674648-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->


    

    
<!-- Baidu Tongji -->
<script>var _hmt = _hmt || []</script>
<script async src="//hm.baidu.com/hm.js?d230cbd4c1f4abd065bc1ca0e61663da"></script>
<!-- End Baidu Tongji -->




    <meta charset="utf-8">
    
    <meta name="google-site-verification" content="x0NhT11Wdmfn9lsdbcQQOIhQHQKeNWATVfTj5rYZWXo">
    
    
    
    
    <title>c语言速学版 | Zhuhao&#39;s Blog | I am the captain of my ship and the master of my fate.</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="入门,c语言">
    <meta name="description" content="本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;amp;R C》等；学习c语言是需要计算机原理的知识的，如果没有可以阅读老刘的系列教程，并关注 码农翻身 公众号获取他的最新教程。学校发的谭某教材就算了吧，不怎么好用，据说还有些错误的地方，而且谭某使用的IDE软件不推荐使用。">
<meta name="keywords" content="入门,c语言">
<meta property="og:type" content="article">
<meta property="og:title" content="c语言速学版">
<meta property="og:url" content="http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/index.html">
<meta property="og:site_name" content="Zhuhao&#39;s Blog">
<meta property="og:description" content="本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;amp;R C》等；学习c语言是需要计算机原理的知识的，如果没有可以阅读老刘的系列教程，并关注 码农翻身 公众号获取他的最新教程。学校发的谭某教材就算了吧，不怎么好用，据说还有些错误的地方，而且谭某使用的IDE软件不推荐使用。">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/c语言速学.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/CodeBlocks界面.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/Dev-C++界面.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/各数据类型表示大小.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/标准I_O.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/字符串.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/ASCII-Table.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/基本运算符表达式.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/for和while循环.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/for和while循环.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/do-while循环.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/if-else.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/if-else-if.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/switch-case.png">
<meta property="og:image" content="http://greedyhao.cc/img/c_language/switch-case-.png">
<meta property="og:updated_time" content="2017-09-13T13:11:56.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="c语言速学版">
<meta name="twitter:description" content="本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;amp;R C》等；学习c语言是需要计算机原理的知识的，如果没有可以阅读老刘的系列教程，并关注 码农翻身 公众号获取他的最新教程。学校发的谭某教材就算了吧，不怎么好用，据说还有些错误的地方，而且谭某使用的IDE软件不推荐使用。">
<meta name="twitter:image" content="http://greedyhao.cc/img/c_language/c语言速学.png">
    
        <link rel="alternate" type="application/atom+xml" title="Zhuhao&#39;s Blog" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.png">
    <link rel="stylesheet" href="//unpkg.com/hexo-theme-material-indigo@latest/css/style.css">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/portrait.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">Greedyhao</h5>
          <a href="mailto:hao_kr@163.com" title="hao_kr@163.com" class="mail">hao_kr@163.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                Archives
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                Tags
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                Categories
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/greedyhao" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">c语言速学版</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">c语言速学版</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-09-09T14:08:36.000Z" itemprop="datePublished" class="page-time">
  2017-09-09
</time>


	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/工作/">工作</a></li></ul>

            
        </h5>
    </div>

    


</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap post-toc-shrink" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#你需要学会什么"><span class="post-toc-number">1.</span> <span class="post-toc-text">你需要学会什么</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#使用什么ide"><span class="post-toc-number">2.</span> <span class="post-toc-text">使用什么IDE</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#codeblocks"><span class="post-toc-number">2.1.</span> <span class="post-toc-text">CodeBlocks</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#dev-c"><span class="post-toc-number">2.2.</span> <span class="post-toc-text">Dev-C++</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#代码规范"><span class="post-toc-number">3.</span> <span class="post-toc-text">代码规范</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#代码基本规则"><span class="post-toc-number">3.1.</span> <span class="post-toc-text">代码基本规则</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#其他一些默认代码规范"><span class="post-toc-number">3.2.</span> <span class="post-toc-text">其他一些默认代码规范</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#数据类型"><span class="post-toc-number">4.</span> <span class="post-toc-text">数据类型</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#c语言标准io"><span class="post-toc-number">5.</span> <span class="post-toc-text">c语言标准I/O</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#格式化输入输出"><span class="post-toc-number">5.1.</span> <span class="post-toc-text">格式化输入输出</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#字符与字符串"><span class="post-toc-number">6.</span> <span class="post-toc-text">字符与字符串</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#运算符与表达式"><span class="post-toc-number">7.</span> <span class="post-toc-text">运算符与表达式</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#基本运算符"><span class="post-toc-number">7.1.</span> <span class="post-toc-text">基本运算符</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#循环"><span class="post-toc-number">8.</span> <span class="post-toc-text">循环</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#for"><span class="post-toc-number">8.1.</span> <span class="post-toc-text">for</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#while"><span class="post-toc-number">8.2.</span> <span class="post-toc-text">while</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#do-while"><span class="post-toc-number">8.3.</span> <span class="post-toc-text">do-while</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#判断与分支"><span class="post-toc-number">9.</span> <span class="post-toc-text">判断与分支</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#if-else"><span class="post-toc-number">9.1.</span> <span class="post-toc-text">if-else</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#switch-case"><span class="post-toc-number">9.2.</span> <span class="post-toc-text">switch-case</span></a></li></ol></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#函数"><span class="post-toc-number">10.</span> <span class="post-toc-text">函数</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#数组"><span class="post-toc-number">11.</span> <span class="post-toc-text">数组</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#指针"><span class="post-toc-number">12.</span> <span class="post-toc-text">指针</span></a></li><li class="post-toc-item post-toc-level-1"><a class="post-toc-link" href="#参考源"><span class="post-toc-number">13.</span> <span class="post-toc-text">参考源</span></a></li></ol>
        </nav>
    </aside>


<article id="post-工作-c-language-2017-09-09-c语言速学版"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">c语言速学版</h1>
        <div class="post-meta">
            <time class="post-time" title="2017-09-09 22:08:36" datetime="2017-09-09T14:08:36.000Z"  itemprop="datePublished">2017-09-09</time>

            
	<ul class="article-category-list"><li class="article-category-list-item"><a class="article-category-list-link" href="/categories/工作/">工作</a></li></ul>



            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <p>本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;R C》等；学习c语言是需要计算机原理的知识的，如果没有可以阅读<a href="https://mp.weixin.qq.com/s/cbaR--hlEN37fwTIRNhKaQ" target="_blank" rel="noopener">老刘的系列教程</a>，并关注 <strong>码农翻身</strong> 公众号获取他的最新教程。学校发的谭某教材就算了吧，不怎么好用，据说还有些错误的地方，而且谭某使用的IDE软件不推荐使用。</p>
<a id="more"></a>
<h1 id="你需要学会什么">你需要学会什么</h1>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/c语言速学.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<h1 id="使用什么ide">使用什么IDE</h1>
<h2 id="codeblocks">CodeBlocks</h2>
<p>CodeBlocks的代码补全能力很强，用着感觉很爽，写代码效率很高。另外奉上<a href="http://greedyhao.cc/2017/09/09/%E5%B7%A5%E4%BD%9C-c-language-2017-09-09-CodeBlocks%E5%88%9B%E5%BB%BAc%E9%A1%B9%E7%9B%AE%E6%95%99%E7%A8%8B/">CodeBlocks创建c项目教程</a></p>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/CodeBlocks界面.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<ul>
<li><a href="http://www.fosshub.com/Code-Blocks.html/codeblocks-16.01-setup.exe" target="_blank" rel="noopener">windows版下载</a></li>
<li><a href="http://www.codeblocks.org/downloads/26" target="_blank" rel="noopener">其他版本在这里查找对应版本</a></li>
</ul>
<h2 id="dev-c">Dev-C++</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/Dev-C++界面.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<ul>
<li><a href="https://downloads.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.11%20TDM-GCC%204.9.2%20Setup.exe?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Forwelldevcpp%2F&amp;ts=1504957705&amp;use_mirror=nchc" target="_blank" rel="noopener">windows版下载</a></li>
</ul>
<p>不推荐使用windows的文本文档编程，别人的程序放进去还有可能会乱码，而且界面看起来low，用过就知道确实不好用；如果真的不想用这些比较重的IDE，可以选择使用sublime atom这类编辑器</p>
<h1 id="代码规范">代码规范</h1>
<h2 id="代码基本规则">代码基本规则</h2>
<ul>
<li>在 .c 源文件开头引入源文件使用到的库函数的 .h 头文件</li>
<li><strong>main</strong> 函数作为程序的入口函数，代码从这里开始运行</li>
<li><strong>main</strong> 函数的返回类型使用 <strong>int</strong></li>
<li>每一句代码以 <strong>;</strong> 结尾</li>
</ul>
<h2 id="其他一些默认代码规范">其他一些默认代码规范</h2>
<p>既然要写代码，肯定要遵循写代码的规则，本教程中的代码都会是符合默认的规范的；但是不同的公司对代码的编写规范可能略微的不同，今后在工作中更是要按照公司的规范编写代码。</p>
<p>个人建议可以参考<a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/coding_style_cn.txt" target="_blank" rel="noopener">RT-Thread 编程风格</a></p>
<h1 id="数据类型">数据类型</h1>
<p>数据类型的话，一般整数用 <strong>int</strong>，上亿的数为了保险就用 <strong>long long</strong>；字符用 <strong>char</strong>；有小数的叫做 <strong>浮点数</strong>，不管什么，直接用 <strong>double</strong>，就好；无符号的就在前面加上 <strong>unsigned</strong>。</p>
<p>下面展示的是所有的数据类型表示数据的大小，有很多没见过也没关系，先见一面。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;limits.h&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"signed char类型的对象的最小值：%d\n"</span>, SCHAR_MIN);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"signed char类型的对象的最大值：%d\n"</span>, SCHAR_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"unsigned char类型的对象的最大值：%u\n"</span>, UCHAR_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"char类型的对象的最小值：%d\n"</span>, CHAR_MIN);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"char类型的对象的最大值：%d\n"</span>, CHAR_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"short int类型的对象的最大值：%d\n"</span>, SHRT_MIN);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"short int类型的对象的最大值：%d\n"</span>, SHRT_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"unsigned short int类型的对象的最大值：%u\n"</span>, USHRT_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"int类型的对象的最小值：%d\n"</span>, INT_MIN);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"int类型的对象的最大值：%d\n"</span>, INT_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"unsigned int类型的对象的最大值：%u\n"</span>, UINT_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"long int类型的对象的最小值：%ld\n"</span>, LONG_MIN);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"long int类型的对象的最大值：%ld\n"</span>, LONG_MAX);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"unsigned long int类型的对象的最大值：%lu\n"</span>, ULONG_MAX);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/各数据类型表示大小.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<h1 id="c语言标准io">c语言标准I/O</h1>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span> </span>&#123;    <span class="comment">//不用在意 int argc, char const *argv[] ，只是让你知道有这么一个东西而已</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"这可以输出你想输出的\n"</span>);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"Even only a '\\n' is OK"</span>);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"\n"</span>);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">int</span> num;</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"输入一个你想输出的数字： "</span>);</span><br><span class="line">    <span class="built_in">scanf</span>(<span class="string">"%d"</span>, &amp;num);                       <span class="comment">//不能忽略'&amp;'符号</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"The num is %d\n"</span>, num);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/标准I_O.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<p>从上面这段程序就可以看出 <strong>输入 scanf</strong> 和 <strong>输出 printf</strong> 的使用方法了。</p>
<h2 id="格式化输入输出">格式化输入输出</h2>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">scanf</span>(<span class="string">"%d"</span>, &amp;num);                       <span class="comment">//不能忽略'&amp;'符号</span></span><br><span class="line"><span class="built_in">printf</span>(<span class="string">"The num is %d\n"</span>, num);</span><br></pre></td></tr></table></figure>
<p>注意到这两句代码的 %d 了没，这就是格式化输入输出，也叫做转换说明。就记个 %d %p %s %c 差不多就够用了，其他的以后用到了再学。</p>
<table>
<thead>
<tr class="header">
<th align="left">转换说明</th>
<th align="left">输出</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left">%a</td>
<td align="left">浮点数、十六进制数和p-记数法(C99)</td>
</tr>
<tr class="even">
<td align="left">%A</td>
<td align="left">浮点数、十六进制数和p-记数法(C99)</td>
</tr>
<tr class="odd">
<td align="left">%c</td>
<td align="left">一个字符</td>
</tr>
<tr class="even">
<td align="left">%d</td>
<td align="left">有符号十进制整数</td>
</tr>
<tr class="odd">
<td align="left">%e</td>
<td align="left">浮点数、e-记数法</td>
</tr>
<tr class="even">
<td align="left">%E</td>
<td align="left">浮点数、E-记数法</td>
</tr>
<tr class="odd">
<td align="left">%f</td>
<td align="left">浮点数、十进制记数法</td>
</tr>
<tr class="even">
<td align="left">%g</td>
<td align="left">根据数值不同自动选择%f或%e。%e格式在指数小于-4或者大于等于精度时使用</td>
</tr>
<tr class="odd">
<td align="left">%G</td>
<td align="left">根据数值不同自动选择%f或%E。%E格式在指数小于-4或者大于等于精度时使用</td>
</tr>
<tr class="even">
<td align="left">%i</td>
<td align="left">有符号十进制整数（与%d相同）</td>
</tr>
<tr class="odd">
<td align="left">%o</td>
<td align="left">无符号八进制整数</td>
</tr>
<tr class="even">
<td align="left">%p</td>
<td align="left">指针</td>
</tr>
<tr class="odd">
<td align="left">%s</td>
<td align="left">字符串</td>
</tr>
<tr class="even">
<td align="left">%u</td>
<td align="left">无符号十进制整数</td>
</tr>
<tr class="odd">
<td align="left">%x</td>
<td align="left">使用十六进制数字0f的无符号十六进制整数</td>
</tr>
<tr class="even">
<td align="left">%X</td>
<td align="left">使用十六进制数字0F的无符号十六进制整数</td>
</tr>
<tr class="odd">
<td align="left">%%</td>
<td align="left">打印一个百分号</td>
</tr>
</tbody>
</table>
<h1 id="字符与字符串">字符与字符串</h1>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/字符串.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<p>上图就是一个字符串&quot;Hello&quot;，但是占据了6个空间，由6个字符构成，末尾有个''字符。</p>
<p>这是因为c语言需要这个字符''来表示这是一个完整的字符串。</p>
<p>以下是最常见的Ascii字符 <figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/ASCII-Table.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure></p>
<h1 id="运算符与表达式">运算符与表达式</h1>
<h2 id="基本运算符">基本运算符</h2>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"1+2=%d\n"</span>, <span class="number">1</span>+<span class="number">2</span>); <span class="comment">//加</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"2-1=%d\n"</span>, <span class="number">2</span><span class="number">-1</span>); <span class="comment">//减</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"1*2=%d\n"</span>, <span class="number">1</span>*<span class="number">2</span>); <span class="comment">//乘</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"1/3.0=%f\n"</span>, <span class="number">1</span>/<span class="number">3.0</span>); <span class="comment">//浮点数的除法</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"1/3=%d\n"</span>, <span class="number">1</span>/<span class="number">3</span>); <span class="comment">//整数除法取整(整数部分)</span></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"1%%3=%d\n"</span>, <span class="number">1</span>%<span class="number">3</span>); <span class="comment">//整数除法取模(余数部分)</span></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/基本运算符表达式.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<h1 id="循环">循环</h1>
<h2 id="for">for</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/for和while循环.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> n;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">for</span> (n = <span class="number">10</span>; n &gt; <span class="number">0</span>; n--) &#123;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="while">while</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/for和while循环.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> n = <span class="number">10</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">while</span> (n &gt; <span class="number">0</span>) &#123;</span><br><span class="line">        n--;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="do-while">do-while</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/do-while循环.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> n = <span class="number">10</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">do</span> &#123;</span><br><span class="line">        n--;</span><br><span class="line">    &#125; <span class="keyword">while</span>(n &gt; <span class="number">0</span>);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h1 id="判断与分支">判断与分支</h1>
<h2 id="if-else">if-else</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/if-else.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span></span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="keyword">int</span> n;</span><br><span class="line"></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"Input a num: "</span>);</span><br><span class="line">    <span class="built_in">scanf</span>(<span class="string">"%d"</span>, &amp;n);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (n &gt; <span class="number">0</span>) &#123;</span><br><span class="line">        n--;</span><br><span class="line">    &#125; <span class="keyword">else</span> <span class="keyword">if</span> (n &lt; <span class="number">0</span>)&#123;</span><br><span class="line">        n++;</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        ;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"n=%d\n"</span>, n);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/if-else-if.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<h2 id="switch-case">switch-case</h2>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/switch-case.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;stdio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">(<span class="keyword">int</span> argc, <span class="keyword">char</span> <span class="keyword">const</span> *argv[])</span> </span>&#123;</span><br><span class="line">    <span class="keyword">int</span> n;</span><br><span class="line"></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">"Input a num: "</span>);</span><br><span class="line">    <span class="built_in">scanf</span>(<span class="string">"%d"</span>, &amp;n);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">switch</span> (n) &#123;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">1</span>: <span class="built_in">printf</span>(<span class="string">"a\n"</span>);<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">2</span>: <span class="built_in">printf</span>(<span class="string">"b\n"</span>);<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="number">3</span>: <span class="built_in">printf</span>(<span class="string">"c\n"</span>);<span class="keyword">break</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="image-bubble">
                <div class="img-lightbox">
                    <div class="overlay"></div>
                    <img src="/img/c_language/switch-case-.png" alt="" title="">
                </div>
                <div class="image-caption"></div>
            </figure>
<h1 id="函数">函数</h1>
<h1 id="数组">数组</h1>
<h1 id="指针">指针</h1>
<h1 id="参考源">参考源</h1>
<ul>
<li><a href="http://blog.csdn.net/h523669057/article/details/7528059" target="_blank" rel="noopener">printf()、scanf()用法总结及其格式转换说明符</a></li>
</ul>

        </div>

        <blockquote class="post-copyright">
    
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-09-13T13:11:56.000Z" itemprop="dateUpdated">2017-09-13 21:11:56</time>
</span><br>


        
        下方的留言框比较调皮，有时候故意不出来，而且还是滚刀肉，实在拿他没办法，所以如果等得不爽可以直接去<a href="https://github.com/greedyhao/greedyhao.github.io/issues" target="_blank" rel="external">issues</a>给我留言
        
    </div>
    
    <footer>
        <a href="http://greedyhao.cc">
            <img src="/img/portrait.jpg" alt="Greedyhao">
            Greedyhao
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/c语言/">c语言</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/入门/">入门</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&title=《c语言速学版》 — Zhuhao's Blog&pic=http://greedyhao.cc/img/portrait.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&title=《c语言速学版》 — Zhuhao's Blog&source=本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;R C》等；..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《c语言速学版》 — Zhuhao's Blog&url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&via=http://greedyhao.cc" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/09/25/工作-Linux-2017-09-25-对fork的进一步理解/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">对fork的进一步理解</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/09/09/工作-c-language-2017-09-09-CodeBlocks创建c项目教程/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">CodeBlocks创建c项目教程</h4>
      </a>
    </div>
  
</nav>



    


<section class="comments" id="comments">
    <div id="disqus_thread"></div>
    <script>
    var disqus_shortname = 'greedyhao';
    lazyScripts.push('//' + disqus_shortname + '.disqus.com/embed.js')
    </script>
    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</section>
















</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢打赏
        <i class="icon icon-quote-right"></i>
    </h3>
    <div class="reward-content">
        
        <div class="reward-code">
            <img id="rewardCode" src="/img/wechat.jpg" alt="打赏二维码">
        </div>
        
        <label class="reward-toggle">
            <input id="rewardToggle" type="checkbox" class="reward-toggle-check"
                data-wechat="/img/wechat.jpg" data-alipay="/img/alipay.jpg">
            <div class="reward-toggle-ctrol">
                <span class="reward-toggle-item wechat">微信</span>
                <span class="reward-toggle-label"></span>
                <span class="reward-toggle-item alipay">支付宝</span>
            </div>
        </label>
        
    </div>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>Greedyhao &copy; 2017 - 2018</span>
            <span>
                
                Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/yscoder/hexo-theme-indigo" target="_blank">indigo</a>
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&title=《c语言速学版》 — Zhuhao's Blog&pic=http://greedyhao.cc/img/portrait.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&title=《c语言速学版》 — Zhuhao's Blog&source=本文只是简单介绍c语言，涉及到计算机原理的知识不会在这里讲解，建议再额外的阅读其他的c语言的书，如《C Primer Plus》《K&amp;R C》等；..." data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《c语言速学版》 — Zhuhao's Blog&url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/&via=http://greedyhao.cc" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://greedyhao.cc/2017/09/09/工作-c-language-2017-09-09-c语言速学版/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };


</script>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/main.min.js"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="//unpkg.com/hexo-theme-material-indigo@latest/js/search.min.js" async></script>



<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
    }
});
</script>

<script async src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML" async></script>




<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '再见';
            clearTimeout(titleTime);
        } else {
            document.title = '你好';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
